package cn.huiyunche.base.service.enums;

/**
 * public enum WaybillStatusEnum {
 * PUBLISHED(10, "已接单"),
 * //	CONFIRMED(30, "待支付"),
 * WAITEXTRACTED(40, "待提车"),
 * EXTRACTED(50, "待发车"),
 * ALREADYSTART(60, "待交车"),
 * //	INTRANSIT(70, "运输中"),
 * COMPLETED(80, "已交车"),
 * DONE(90, "已完成");
 */

/**
 * 运单状态枚举类
 * @author Administrator
 *
 */
public enum WaybillStatusEnum {
    WAITBID(10, "待接单"),
    ALREADYBID(20, "已接单"),
    WAITEXTRACTED(30, "待提车"),
    EXTRACTED(40, "已提车"),
    WAITSTART(50, "待发车"),
    WAITCOMPLETE(60, "待交车"),
    COMPLETED(80, "已交车"),
    DONE(90, "已完成"),
    CANCELED(100, "已取消");

    private final int value;
    private final String text;

    WaybillStatusEnum(int value, String text) {
        this.value = value;
        this.text = text;
    }

    public int getValue() {
        return value;
    }

    public String getText() {
        return text;
    }

    public static WaybillStatusEnum getByValue(int value) {
        for (WaybillStatusEnum temp : WaybillStatusEnum.values()) {
            if (temp.getValue() == value) {
                return temp;
            }
        }
        return null;
    }
}
